package com.liao.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.liao.common.entity.order.OrderItemEntity;
import com.liao.common.entity.product.SkuEntity;
import com.liao.common.utils.PageUtils;

import java.util.List;
import java.util.Map;

/**
 * 商品SKU库存单元
 *
 * @author liao
 * @email 2858015963@qq.com
 * @date 2025-02-13 13:26:53
 */
public interface SkuService extends IService<SkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 锁定库存
     *
     * @param orderItemEntities
     */
    void lockStock(List<OrderItemEntity> orderItemEntities);

    /**
     * 、
     * 解锁库存
     *
     * @param skuId
     * @param num
     */
    void unlockStock(Integer skuId, Integer num);
}

